﻿<%@ Page Title="Client Details" Language="C#" MasterPageFile="~/MasterPage.master"
    AutoEventWireup="true" CodeFile="View_Client.aspx.cs" Inherits="admin_View_Client" %>

<asp:Content ID="Head" ContentPlaceHolderID="head" runat="Server">
    <link href="../styles/admin.css" rel="stylesheet" type="text/css" />

    <script src="../javascripts/jquery-1.4.3.min.js" type="text/javascript"></script>

    <script src="../javascripts/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function() {
            $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' });
        });  
    </script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
     <div id="top_menu">
        <div id="help_button">
            help
        </div>
                                <div id="logout">
            <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutPageUrl="../Default.aspx"
                OnLoggingOut="LoginStatus1_LoggingOut" />
        </div>
    </div>
    <div id="page_title">
        ADMINISTRATION
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div id="left_content">
        <div class="menu">
            <ul>
                <li><a href="Home.aspx">Home</a></li>
                <li><a href="#" class="current">View Client Details</a></li>
                <li><a href="Mng_Site.aspx">Manage Sites</a></li>
                <li><a href="Mng_Machine.aspx">Manage Machines</a></li>
                <li><a href="Mng_Comp.aspx">Manage Components</a></li>
                <li><a href="Mng_Report.aspx">Manage Reports</a></li>
                <li><a href="Mng_WO.aspx">Manage Work Order</a></li>
                <li><a href="Mng_FaultsRecom.aspx">Manage Faults Recommendation</a></li>
            </ul>
        </div>
    </div>
    <!-- end of left content -->
    <div id="right_content">
        <div class="content_area">
            <h2>
                Client Details
            </h2>
            <div class="form_box1">
                <asp:FormView ID="FormViewClient" runat="server" DataKeyNames="client_id" DataSourceID="ClientsObjectDataSource" OnItemUpdating="client_updating" onitemupdated="client_ItemUpdated" >
                    <EditItemTemplate>
                        <table>
                            <tr>
                                <td class="label1">
                                    Client ID:
                                </td>
                                <td class="label" colspan="2">
                                    <asp:Label ID="client_idLabel" runat="server" Text='<%# Eval("client_id") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Client Name:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="clientNameTextBox" runat="server" Text='<%# Bind("clientName") %>'
                                        ToolTip="Client Name is required." AutoCompleteType="Company" CssClass="fields1" />
                                    <asp:RequiredFieldValidator ID="ClientNameRequired" runat="server" ControlToValidate="clientNameTextBox"
                                        ErrorMessage="Client Name is required." ValidationGroup="FormViewClient"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Contact Person:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="contactPersonTextBox" runat="server" Text='<%# Bind("contactPerson") %>'
                                        AutoCompleteType="DisplayName" ToolTip="Contact Person is required." CssClass="fields1" />
                                    <asp:RequiredFieldValidator ID="contactPersonRequired" runat="server" ErrorMessage="Contact Person is required"
                                        ControlToValidate="contactPersonTextBox" ValidationGroup="FormViewClient"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Status:
                                </td>
                                <td colspan="2">
                                    <asp:DropDownList ID="statusDropDownList" runat="server" Text='<%# Bind("status") %>'
                                        CssClass="dropDownList">
                                        <asp:ListItem Value="Deactivated">Deactivated</asp:ListItem>
                                        <asp:ListItem Value="Activated">Activated</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Address:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' CssClass="fields1"
                                        TextMode="MultiLine" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Mobile Phone:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="phoneMobileTextBox" runat="server" Text='<%# Bind("phoneMobile") %>'
                                        CssClass="fields1" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Work Phone:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="phoneWorkTextBox" runat="server" Text='<%# Bind("phoneWork") %>'
                                        CssClass="fields1" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Fax:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="faxTextBox" runat="server" Text='<%# Bind("fax") %>' CssClass="fields1" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Email:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="emailTextBox" runat="server" Text='<%# Bind("email") %>' CssClass="fields1" />
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="emailTextBox"
                                        ErrorMessage="E-mail is required." ValidationGroup="FormViewCreateClient"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="EmailRegularExpressionValidator" runat="server"
                                        ErrorMessage="Email address is not valid" ValidationGroup="FormViewCreateClient"
                                        ControlToValidate="emailTextBox" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Distribution Email:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="distributionEmailTextBox" runat="server" Text='<%# Bind("distributionEmail") %>'
                                        CssClass="fields1" />
                                    <asp:RegularExpressionValidator ID="DisEmailRegularExpressionValidator" runat="server"
                                        ErrorMessage="Email address is not valid" ValidationGroup="FormViewCreateClient"
                                        ControlToValidate="distributionEmailTextBox" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Parent Client:
                                </td>
                                <td colspan="2">
                                    <asp:DropDownList ID="ParentDropDownList" runat="server" AppendDataBoundItems="True"
                                        Text='<%# Bind("parent_client_id") %>' DataSourceID="ParentsObjectDataSource" 
                                        DataTextField="clientName" DataValueField="client_id" SelectedValue='<%# Bind("parent_client_id") %>' 
                                        CssClass="dropDownList">
										<asp:ListItem Enabled="True" Text="No Parent" Value="0"></asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:ObjectDataSource ID="ParentsObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                                        SelectMethod="GetData" TypeName="DataAccess.i2iPortalTableAdapters.ClientsTableAdapter">
                                    </asp:ObjectDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Paid Status:
                                </td>
                                <td colspan="2">
                                    <asp:DropDownList ID="paid_statusDropDownList" runat="server" Text='<%# Bind("paid_status") %>'
                                        CssClass="dropDownList">
                                        <asp:ListItem Value="Not Paid">Not Paid</asp:ListItem>
                                        <asp:ListItem Value="Paid">Paid</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="label1">
                                    Next Survey Date:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="date_registeredTextBox" runat="server" Text='<%# Bind("date_registered", "{0:dd/MM/yyyy}") %>'
                                        class="datepicker" />
                                </td>
                            </tr>
                                        <tr>
                                <td class="label1">
                                    Work Scheduled:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="licenced_startTextBox" runat="server" CssClass="fields1"  Text='<%# Bind("licenced_start") %>'
                                    />
                                </td>
                            </tr>
                            <tr>
   <%--                         <tr>
                             <td class="label1">
                                    Licenced Start:
                                </td>
                               <td colspan="2">
                                 Text='<%# Bind("licenced_start") %>'
                                    <asp:TextBox ID="licenced_startTextBox" runat="server" Text ='<%# Bind("licenced_start", "{0:dd/MM/yyyy}") %>'
                                         class="datepicker" />
                                </td>
                            </tr>--%>
                            <tr>
                                <td class="label1">
                                    Licenced Expired:
                                </td>
                                <td colspan="2">
                                    <asp:TextBox ID="licenced_expiredTextBox" runat="server" Text='<%# Bind("licenced_expired", "{0:dd/MM/yyyy}") %>'
                                        class="datepicker" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td class="Li_buttonC">
                                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" 
                                        Text="Update"  />
                                </td>
                                <td class="Li_buttonC">
                                    <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                        Text="Cancel" />
                                </td>
                            </tr>
                        </table>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        client_id:
                        <asp:TextBox ID="client_idTextBox" runat="server" Text='<%# Bind("client_id") %>' />
                        <br />
                        clientName:
                        <asp:TextBox ID="clientNameTextBox" runat="server" Text='<%# Bind("clientName") %>' />
                        <br />
                        address:
                        <asp:TextBox ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' />
                        <br />
                        contactPerson:
                        <asp:TextBox ID="contactPersonTextBox" runat="server" Text='<%# Bind("contactPerson") %>' />
                        <br />
                        phoneMobile:
                        <asp:TextBox ID="phoneMobileTextBox" runat="server" Text='<%# Bind("phoneMobile") %>' />
                        <br />
                        phoneWork:
                        <asp:TextBox ID="phoneWorkTextBox" runat="server" Text='<%# Bind("phoneWork") %>' />
                        <br />
                        fax:
                        <asp:TextBox ID="faxTextBox" runat="server" Text='<%# Bind("fax") %>' />
                        <br />
                        email:
                        <asp:TextBox ID="emailTextBox" runat="server" Text='<%# Bind("email") %>' />
                        <br />
                        distributionEmail:
                        <asp:TextBox ID="distributionEmailTextBox" runat="server" Text='<%# Bind("distributionEmail") %>' />
                        <br />
                        status:
                        <asp:TextBox ID="statusTextBox" runat="server" Text='<%# Bind("status") %>' />
                        <br />
                        parent_client_id:
                        <asp:TextBox ID="parent_client_idTextBox" runat="server" Text='<%# Bind("parent_client_id") %>' />
                        <br />
                        paid_status:
                        <asp:TextBox ID="paid_statusTextBox" runat="server" Text='<%# Bind("paid_status") %>' />
                        <br />
                        Next Survey Date:
                        <asp:TextBox ID="date_registeredTextBox"  runat="server" Text='<%# Bind("date_registered") %>' />
                        <br />
                        work scheduled:
                        <asp:TextBox ID="nextsurvey_desTextBox"  runat="server" 
                            Text='<%# Bind("nextsurvey_des") %>' />
                        <br />
                    <%--    licenced_start:
                        <asp:TextBox ID="licenced_startTextBox" runat="server" Text='<%# Bind("licenced_start") %>' />
                        <br />
                  --%>      licenced_expired:
                        <asp:TextBox ID="licenced_expiredTextBox" runat="server" Text='<%# Bind("licenced_expired") %>' />
                        <br />
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                            Text="Insert" />
                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                            CommandName="Cancel" Text="Cancel" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td class="label">
                                    Client ID:
                                </td>
                                <td>
                                    <asp:Label ID="client_idLabel" runat="server" Text='<%# Eval("client_id") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Client Name:
                                </td>
                                <td>
                                    <asp:Label ID="clientNameLabel" runat="server" Text='<%# Bind("clientName") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Contact Person:
                                </td>
                                <td>
                                    <asp:Label ID="contactPersonLabel" runat="server" Text='<%# Bind("contactPerson") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Status:
                                </td>
                                <td>
                                    <asp:Label ID="statusLabel" runat="server" Text='<%# Bind("status") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Address:
                                </td>
                                <td>
                                    <asp:Label ID="addressTextBox" runat="server" Text='<%# Bind("address") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Mobile Phone:
                                </td>
                                <td>
                                    <asp:Label ID="phoneMobileLabel" runat="server" Text='<%# Bind("phoneMobile") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Work Phone:
                                </td>
                                <td>
                                    <asp:Label ID="phoneWorkLabel" runat="server" Text='<%# Bind("phoneWork") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Fax:
                                </td>
                                <td>
                                    <asp:Label ID="faxLabel" runat="server" Text='<%# Bind("fax") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Email:
                                </td>
                                <td>
                                    <asp:Label ID="emailLabel" runat="server" Text='<%# Bind("email") %>' CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Distribution Email:
                                </td>
                                <td>
                                    <asp:Label ID="distributionEmailLabel" runat="server" Text='<%# Bind("distributionEmail") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Parent Client ID:
                                </td>
                                <td>
                                    <asp:Label ID="parent_client_idLabel" runat="server" Text='<%# Bind("parent_client_id") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Paid Status:
                                </td>
                                <td>
                                    <asp:Label ID="paid_statusLabel" runat="server" Text='<%# Bind("paid_status") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td class="label">
                                    Next Survey Date:
                                </td>
                                <td>
                                    <asp:Label ID="date_registeredLabel" runat="server" Text='<%# Bind("date_registered", "{0:dd/MM/yyyy}") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                                               <tr>
                                <td class="label">
                                    Work Scheduled:
                                </td>
                                <td>
                                    <asp:Label ID="workscheduled_label" runat="server" Text='<%# Bind("licenced_start") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                          <%--  <tr>
                                <td class="label">
                                    Licenced Start:
                                </td>
                                <td>
                                    <asp:Label ID="licenced_startLabel" runat="server" Text='<%# Bind("licenced_start", "{0:dd/MM/yyyy}") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>--%>
                            <tr>
                                <td class="label">
                                    Licenced Expired:
                                </td>
                                <td>
                                    <asp:Label ID="licenced_expiredLabel" runat="server" Text='<%# Bind("licenced_expired", "{0:dd/MM/yyyy}") %>'
                                        CssClass="fields" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td class="Li_buttonC">
                                    <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                        Text="Edit" />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    
                </asp:FormView>
                <asp:ObjectDataSource ID="ClientsObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetDataByClientID"
                    TypeName="DataAccess.i2iPortalTableAdapters.ClientsTableAdapter" 
                    InsertMethod="Insert" UpdateMethod="Update" DeleteMethod="Delete"
                  >
                    <DeleteParameters>
                        <asp:Parameter Name="Original_client_id" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="clientName" Type="String" />
                        <asp:Parameter Name="address" Type="String" />
                        <asp:Parameter Name="contactPerson" Type="String" />
                        <asp:Parameter Name="phoneMobile" Type="String" />
                        <asp:Parameter Name="phoneWork" Type="String" />
                        <asp:Parameter Name="fax" Type="String" />
                        <asp:Parameter Name="email" Type="String" />
                        <asp:Parameter Name="distributionEmail" Type="String" />
                        <asp:Parameter Name="status" Type="String" />
                        <asp:Parameter Name="parent_client_id" Type="Int32" />
                        <asp:Parameter Name="paid_status" Type="String" />
                        <asp:Parameter Name="date_registered" Type="DateTime" />
                        <asp:Parameter Name="licenced_start" Type="String" />
                        <asp:Parameter Name="licenced_expired" Type="DateTime" />
                        <asp:Parameter Name="service_type" Type="String" />
                        <asp:Parameter Name="Original_client_id" Type="Int32" />
                    </UpdateParameters>
                    <SelectParameters>
                        <asp:QueryStringParameter Name="client_id" QueryStringField="client_id" Type="Int32" />
                    </SelectParameters>
                    <InsertParameters>
                        <asp:Parameter Name="client_id" Type="Int32" />
                        <asp:Parameter Name="clientName" Type="String" />
                        <asp:Parameter Name="address" Type="String" />
                        <asp:Parameter Name="contactPerson" Type="String" />
                        <asp:Parameter Name="phoneMobile" Type="String" />
                        <asp:Parameter Name="phoneWork" Type="String" />
                        <asp:Parameter Name="fax" Type="String" />
                        <asp:Parameter Name="email" Type="String" />
                        <asp:Parameter Name="distributionEmail" Type="String" />
                        <asp:Parameter Name="status" Type="String" />
                        <asp:Parameter Name="parent_client_id" Type="Int32" />
                        <asp:Parameter Name="paid_status" Type="String" />
                        <asp:Parameter Name="date_registered" Type="DateTime" />
                        <asp:Parameter Name="licenced_start" Type="String" />
                        <asp:Parameter Name="licenced_expired" Type="DateTime" />
                        <asp:Parameter Name="service_type" Type="String" />
                    </InsertParameters>
                        
                </asp:ObjectDataSource>
            </div>
        </div>
        <div class="content_area2">
                   <h2>
                Users on Client
            </h2>
            <div class="form_box">
                <%--<asp:GridView ID="GridViewUsers" runat="server" AutoGenerateColumns="False" DataKeyNames="user_id"
                    DataSourceID="ObjectDataSourceUsers" EmptyDataText="There are no login account associated with this client"
                    AllowSorting="True" PagerStyle-CssClass="pager" HeaderStyle-CssClass="header">
                    <Columns>
                       
                        <asp:BoundField DataField="name" HeaderText="Full Name" SortExpression="name" ItemStyle-CssClass="column">
                            <ItemStyle CssClass="column"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="email" HeaderText="Email" SortExpression="email" ItemStyle-CssClass="column">
                            <ItemStyle CssClass="column"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Role" SortExpression="role" ItemStyle-CssClass="column">
                            <EditItemTemplate>
                                <asp:DropDownList ID="roleDropDownList" runat="server" SelectedValue='<%# Bind("role") %>'>
                                    <asp:ListItem Text="Admin" Value="Admin"></asp:ListItem>
                                    <asp:ListItem Text="Staff" Value="Staff"></asp:ListItem>
                                </asp:DropDownList>
                                
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="roleLabel" runat="server" Text='<%# Bind("role") %>'></asp:Label></ItemTemplate>
                            <ItemStyle CssClass="column"></ItemStyle>
                        </asp:TemplateField>
                         <asp:CommandField ShowEditButton="True" />
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="Delete" OnClientClick='return confirm("Are you sure you want to delete this entry?");'></asp:LinkButton></ItemTemplate>
                            <ItemStyle CssClass="column" />
                        </asp:TemplateField>
                        
                        <asp:BoundField DataField="password" HeaderText="password" 
                            SortExpression="password" />
                        
                    </Columns>
                    <PagerStyle CssClass="pager"></PagerStyle>
                    <HeaderStyle CssClass="header"></HeaderStyle>
                </asp:GridView>--%>
                <%--<asp:ObjectDataSource ID="ObjectDataSourceUsers" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetDataByClientID" TypeName="DataAccess.i2iPortalTableAdapters.UsersTableAdapter"
                    DeleteMethod="Delete" InsertMethod="Insert"  OnUpdating="user_updating">
                    <DeleteParameters>
                        <asp:Parameter Name="Original_user_id" Type="Int32" />
                    </DeleteParameters>
                    <SelectParameters>
                        <asp:QueryStringParameter Name="client_id" QueryStringField="client_id" Type="Int32" />
                    </SelectParameters>
                    <InsertParameters>
                        <asp:Parameter Name="username" Type="String" />
                        <asp:Parameter Name="password" Type="String" />
                        <asp:Parameter Name="is_admin" Type="String" />
                        <asp:Parameter Name="role" Type="String" />
                        <asp:Parameter Name="client_id" Type="Int32" />
                        <asp:Parameter Name="name" Type="String" />
                        <asp:Parameter Name="email" Type="String" />
                    </InsertParameters>
                </asp:ObjectDataSource>--%>
                   <br />
                <asp:GridView ID="GridView_users" runat="server" AutoGenerateColumns="False" 
                    OnRowUpdating="user_updating" OnRowEditing="TaskGridView_RowEditing"
                   OnRowCancelingEdit="TaskGridView_RowCancelingEdit">
                    <Columns>
                                   
                        <asp:BoundField DataField="username" HeaderText="NAME" />
                         <asp:BoundField DataField="password" HeaderText="PASSWORD" />
                    <asp:TemplateField HeaderText="ROLE">
                        
                            <EditItemTemplate>
                                <asp:DropDownList runat="server" ID="role_dropdownlist" DataValueField='<%#Eval("role") %>'>
                                    <asp:ListItem Text="ADMIN" Value="Admin"></asp:ListItem>
                                    <asp:ListItem Text="STAFF" Value="Staff"></asp:ListItem>
                                </asp:DropDownList>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <%#Eval("role") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="email" HeaderText="EMAIL" ApplyFormatInEditMode="True" />
                  <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="Edit"></asp:LinkButton>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                    Text="Update"></asp:LinkButton>
                                <br />
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="Cancel"></asp:LinkButton>
                                            <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("user_id") %>' /> 
          
                            </EditItemTemplate>
                        </asp:TemplateField>
                          </Columns>
                    
                </asp:GridView>
 
                <asp:Button ID="CreateAccountButton" runat="server" Text="Create New Account" OnClick="CreateAccountButton_Click"
                    CssClass="buttons" />
            </div>
        </div>
        <div class="content_area2">
            <h2>
                Sites on Client
            </h2>
            <div class="form_box">
                <asp:GridView ID="GridViewSites" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                    DataKeyNames="site_id" DataSourceID="SitesObjectDataSource" OnSelectedIndexChanged="GridViewSites_SelectedIndexChanged">
                    <Columns>
                        <asp:BoundField DataField="siteName" HeaderText="Site Name" SortExpression="siteName">
                            <ItemStyle CssClass="column" />
                        </asp:BoundField>
                        <asp:BoundField DataField="status" HeaderText="Status" SortExpression="status">
                            <ItemStyle CssClass="column" />
                        </asp:BoundField>
                        <asp:CommandField SelectText="Details..." ShowSelectButton="True">
                            <ItemStyle CssClass="column" />
                        </asp:CommandField>
                    </Columns>
                    <HeaderStyle CssClass="header" />
                </asp:GridView>
                <asp:ObjectDataSource ID="SitesObjectDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetDataByClientID" TypeName="DataAccess.i2iPortalTableAdapters.SitesTableAdapter">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="client_id" QueryStringField="client_id" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <br />
                <asp:Button ID="CreateSiteButton" runat="server" OnClick="CreateSiteButton_Click"
                    Text="Add New Site" CssClass="buttons" />
            </div>
        </div>
        <asp:LinkButton ID="BackButton" runat="server" PostBackUrl="Mng_Client.aspx" CssClass="backbtn">Back</asp:LinkButton></div>
    <!-- end of right content -->
</asp:Content>
